package com.nn.smart.bus.common.token.enums;

import com.nn.smart.bus.common.token.error.IErrorCode;

/**
 * client token错误码
 *
 * @author nanning
 * @Date 18-11-24
 */
public enum ErrorCode implements IErrorCode {

    SUCCESS(0, "请求成功"),

    ERR10001(10001, "clientToken不合法或者已过期"),
    ERR10002(10002, "无法获取当前用户的信息，无法生成clientToken。"),
    ERR10003(10003, "clientToken生成失败，请重试。"),
    ERR10004(10004, "返回的Object类型不是EsuaResponse，无法添加token!"),
    ERR10005(10005, "clentToken不能为空"),

    ERR500(500, "Internal Server Error"),
    ERR501(501, "参数绑定异常"),

    ERR(ErrorCode.COMMON_ERR_CODE, "其他异常");

    private int code;

    private String msg;

    ErrorCode(final int code, final String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static final int COMMON_ERR_CODE = -1;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
